<?php
/**
* 
*/
// Detta är den filen som hjälper till med fil upladdningen 
$target = "uploads/"; 
$target = $target . basename( $_FILES['uploaded']['name']) ; 
$ok = 1; 
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) 
{
	// skriver ut vad som laddes upp för att sedan skicka tillbaka en efter ca 3 sek. 
	header('Refresh: 3; URL=/Labb1/labb2/');
	echo "The file ". basename( $_FILES['uploaded']['name']). " has been uploaded";
} 
else {
		//skickar fel medelande. 
		header('Refresh: 5; URL=/Labb1/labb2/');
	 	echo "Sorry, there was a problem uploading your file.";
	 }
?>
